local sk__zhonghou_viewas = fk.CreateSkill {

  name = "sk__zhonghou&",

  tags = {  },

}



sk__zhonghou_viewas:addEffect("viewas", {
  name = "sk__zhonghou&",
  pattern = ".|.|.|.|.|basic",
  prompt = "#sk__zhonghou&",
  interaction = function(self,player)
    local all_names = Fk:getAllCardNames("b")
    local names = player.getViewAsCardNames(player, sk__zhonghou_viewas.name, all_names)
    if #names == 0 then return false end
    return UI.CardNameBox { choices = names, all_choices = all_names }
  end,
  card_filter = Util.FalseFunc,
  view_as = function(self, player,cards)
    if not self.interaction.data then return end
    local card = Fk:cloneCard(self.interaction.data)
    card.skillName = sk__zhonghou_viewas.name
    return card
  end,
  before_use = function(self, player, use)
    local room = player.room
    local yes = false
    for _, p in ipairs(room:getOtherPlayers(player)) do
      if p:hasSkill("sk__zhonghou") and p:inMyAttackRange(player) then
        if room:askForSkillInvoke(p, "sk__zhonghou", nil, "#sk__zhonghou-ask::"..player.id..":"..use.card.name) then
          room:loseHp(p, 1, "sk__zhonghou")
          yes = true
          break
        end
      end
    end
    if not yes then
      return ""
    end
  end,
  enabled_at_play = function(self, player)
    return player:usedSkillTimes(sk__zhonghou_viewas.name, Player.HistoryTurn) == 0 and
      table.find(Fk:currentRoom().alive_players, function (p)
        return p:hasSkill("sk__zhonghou") and p ~= player and p:inMyAttackRange(player)
      end)
  end,
  enabled_at_response = function(self, player, response)
    return player:usedSkillTimes(sk__zhonghou_viewas.name, Player.HistoryTurn) == 0 and
      table.find(Fk:currentRoom().alive_players, function (p)
        return p:hasSkill("sk__zhonghou") and p ~= player and p:inMyAttackRange(player)
      end)
  end,
})

return sk__zhonghou_viewas